package cn.lili.modules.search.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
import cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo;
import cn.lili.modules.search.entity.dto.CustomSearchParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.elasticsearch.core.SearchPage;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author: ftyy
 * @date: 2021-12-25 18:19
 * @description: 自定义分词 client
 */
@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.GOODS_SERVICE, contextId = "es-search")
public interface EsGoodsSearchClient {


    /**
     * 自定义商品搜索
     *
     * @param customSearchParams 自定义搜索条件
     * @return
     */
    @PostMapping("/feign/goods/es/search")
    SearchPage<EsGoodsIndex> customSearch(@RequestBody CustomSearchParams customSearchParams);

    /**
     * 自定义商品搜索
     *
     * @param customSearchParams 自定义搜索条件
     * @return
     */
    @PostMapping("/feign/goods/es/search/related")
    EsGoodsRelatedInfo related(@RequestBody CustomSearchParams customSearchParams);
}
